import axios from 'axios';
import queryString from 'querystring';


let api = {
  getList: '/api-product/v1/reservationRecord/list', //列表
  exportList: '/api-product/v1/reservationRecord/excel', //导出
  detail: '/api-product/v1/reservationRecord/detail?id=', //详情
  update: '/api-product/v1/reservationRecord/update', //修改
  recordStatus: '/api-product/v1/optionDetails/recordStatus/type', //预约状态
  userInfo: '/api-hks/v1/common/supply/getUserView?phone=', //用户信息
}

const getList = (params) => {
  return axios.get(api.getList, {params: params})
}

const getExcelList = (params) => {
  return axios.get(api.exportList, {params: params})
}

const getDetail = (id) => {
  return axios.get(api.detail + id)
}

const postUpdate = (params) => {
  return axios.post(api.update, params)
}

const getRecordStatus = () => {
  return axios.get(api.recordStatus)
}

const getUserInfo = (phone) => {
  return axios.get(api.userInfo + phone)
}


export {
  api,
  getList,
  getExcelList,
  getDetail,
  postUpdate,
  getRecordStatus,
  getUserInfo
}
